Configuring the Application Server
ColdFusion MX standalone and previous versions of ColdFusion limited administrators to using a single instance of ColdFusion. If one application caused server failure, it affected all other applications running in the server. ColdFusion MX for J2EE allows administrators to create multiple instances of ColdFusion on a single server, which reduces the chances of a single application causing complete server failure. By extending ColdFusion applications across multiple servers, administrators can leverage the clustering capability of their J2EE application server. By coupling enterprise-level J2EE application servers with hardware load-balancing devices administrators can provide a scalable, redundant enterprise-level architecture.
In this article, we use two physical servers with two instances of JRun running ColdFusion MX for J2EE on each server. The following diagram illustrates the architecture.

Figure 3: Architecture diagram used for this article.
Note: Although this diagram shows two separate BigIP boxes, you can use a single BigIP or other hardware load-balancing device to service both the web server and application server pool.
Building and Deploying a ColdFusion MX for J2EE Cluster
The following steps give an overview on building and deploying a ColdFusion MX for J2EE cluster. Follow the steps immediately after this overview for detailed information.
- Install JRun 4 on each server you plan to cluster.
- Create any number of JRun instances.
- Install ColdFusion MX for J2EE/JRun as a WAR file on each physical server that you plan to cluster.
- Copy and extract the WAR file to the JRun server directory of each instance that you plan to cluster.
- Start all servers in the cluster.
- Configure ColdFusion MX for J2EE through the wizard.
- Configure server settings in the ColdFusion Administrator.
- Perform any ColdFusion Administrator configurations (mappings, database connections, and so forth) and deploy your ColdFusion application.
Follow these detailed steps for building and deploying a ColdFusion MX for J2EE cluster:
- Install JRun 4 on all servers that you plan to cluster. Use the steps in the JRun LiveDoc instructions. After installing JRun 4, start the Admin server for each server in the cluster.
- To create JRun instances, open the JMC, click Create New Server,
and follow the instructions in the wizard:

Figure 4: Create a new JRun server through the JMC.
Figure 5: Modify the JRun Web Server (JWS) port to match your particular architecture. For this example, we are using ports 8500 and 8600 on each server.
- Install ColdFusion MX for J2EE on each server in the cluster using the WAR deployment option. The installer will install to a temporary location. In the next step, you will take the installed files and deploy them onto JRun. Choose a context root other than /. For this example, I used /cfusion.
-
Deploy the WAR file to each JRun server in the cluster.
- Locate the cfusion.war file that the ColdFusion MX for J2EE installer created.
- Create a /cfusion folder for each server root in the cluster. ({jrun-root}/servers/cfmxjrun1/cfusion, {jrun-root}/servers/cfmxjrun2/cfusion, and so forth).
- Copy the cfusion.war file to each /cfusion folder you created in step b.
- Use either WinZip or JAR to extract the WAR file to the /cfusion folder (For example: c:\JRun4\servers\cfmxjrun1\cfusion>jar xvf cfusion.war).
- After extracting, the folder contains the following folders: CFIDE, META-INF, and WEB-INF. It should also contain several HTML and CFML files.
- Delete cfusion.war from the /cfusion folder.
- Start all JRun instances that will be part of the cluster.
-
Using the built-in JRun web server, open web browser to walk through the ColdFusion MX for J2EE configuration wizard at: http://server:port/contextroot. For this example, you must configure each of the four servers in the cluster: http://10.15.1.34:8500/cfusion, http://10.15.1.34:8600/cfusion, http://10.15.1.43:8500/cfusion, and http://10.15.1.43:8600/cfusion.
Use the following steps for each server:
- Enter the serial number.
- Do not enable RDS.
- Install the JDBC services if you need them.
- Do not install the example applications on a production server.
- If the ColdFusion Administrator appears after completing the wizard, your ColdFusion install was successful.
-
Log into the ColdFusion Administrator. Click the Memory Variables link under the Server Settings section.
- Check the box for Use J2EE Session Variables and click Submit Changes.
- Repeat steps 6 and 7 for all servers that you will cluster.
- Copy your ColdFusion Application to the ColdFusion application root folder of every server in the cluster: ({jrun-root}/servers/{servername}/cfusion/). Create data sources, mappings, and any other settings to the ColdFusion Administrator for every server in the cluster. To simplify this process, you can deploy to one server and create a ColdFusion archive and deploy it to the rest of the servers in the cluster.